<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>Sifteo SDK: Sifteo::Colormap Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-style-overrides.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<center>
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Sifteo SDK" src="sdk_logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">
   &#160;<span id="projectnumber">v1.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
</center>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Home</span></a></li>
      <li><a href="pages.html"><span>Guides</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>Sifteo</b></li><li class="navelem"><a class="el" href="struct_sifteo_1_1_colormap.html">Colormap</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="struct_sifteo_1_1_colormap-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Sifteo::Colormap Struct Reference<div class="ingroups"><a class="el" href="group__video.html">Video</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>An accessor for the colormap, with up to 16 colors.  
 <a href="struct_sifteo_1_1_colormap.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="color_8h_source.html">sifteo/video/color.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ac7c79efa7d94c0e78e71554963c5c06f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac7c79efa7d94c0e78e71554963c5c06f"></a>
<a class="el" href="struct_sifteo_1_1_cube_i_d.html">CubeID</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_colormap.html#ac7c79efa7d94c0e78e71554963c5c06f">cube</a> () const </td></tr>
<tr class="memdesc:ac7c79efa7d94c0e78e71554963c5c06f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the <a class="el" href="struct_sifteo_1_1_cube_i_d.html" title="A lightweight identifier for one Sifteo cube.">CubeID</a> associated with this drawable. <br/></td></tr>
<tr class="separator:ac7c79efa7d94c0e78e71554963c5c06f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3cb51e19311327f79400a846f39abc7e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3cb51e19311327f79400a846f39abc7e"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_colormap.html#a3cb51e19311327f79400a846f39abc7e">erase</a> ()</td></tr>
<tr class="memdesc:a3cb51e19311327f79400a846f39abc7e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear the palette to black. <br/></td></tr>
<tr class="separator:a3cb51e19311327f79400a846f39abc7e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac9736ed9c94b30efd46aba1624405d9e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac9736ed9c94b30efd46aba1624405d9e"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_colormap.html#ac9736ed9c94b30efd46aba1624405d9e">fill</a> (<a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a> color)</td></tr>
<tr class="memdesc:ac9736ed9c94b30efd46aba1624405d9e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Splat the given color across all colormap slots. <br/></td></tr>
<tr class="separator:ac9736ed9c94b30efd46aba1624405d9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acacffa36ca71f5ca1f59bfbc3aadc5be"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_sifteo_1_1_colormap_slot.html">ColormapSlot</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_colormap.html#acacffa36ca71f5ca1f59bfbc3aadc5be">operator[]</a> (unsigned index)</td></tr>
<tr class="memdesc:acacffa36ca71f5ca1f59bfbc3aadc5be"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return a <a class="el" href="struct_sifteo_1_1_colormap_slot.html" title="A ColormapSlot refers to a single colormap index on a single cube.">ColormapSlot</a> which references a single colormap entry on a single <a class="el" href="struct_sifteo_1_1_video_buffer.html" title="A memory buffer which holds graphics data.">VideoBuffer</a>.  <a href="#acacffa36ca71f5ca1f59bfbc3aadc5be">More...</a><br/></td></tr>
<tr class="separator:acacffa36ca71f5ca1f59bfbc3aadc5be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7eb563edf7aed6010e5015ee0adf5d8c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7eb563edf7aed6010e5015ee0adf5d8c"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_colormap.html#a7eb563edf7aed6010e5015ee0adf5d8c">set</a> (const <a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a> *colors)</td></tr>
<tr class="memdesc:a7eb563edf7aed6010e5015ee0adf5d8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the entire palette, given an array of exactly 16 <a class="el" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> values. <br/></td></tr>
<tr class="separator:a7eb563edf7aed6010e5015ee0adf5d8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3262a55bf13333943c351666047c59ff"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_colormap.html#a3262a55bf13333943c351666047c59ff">setEGA</a> ()</td></tr>
<tr class="memdesc:a3262a55bf13333943c351666047c59ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the entire palette to the traditional EGA 16-color palette.  <a href="#a3262a55bf13333943c351666047c59ff">More...</a><br/></td></tr>
<tr class="separator:a3262a55bf13333943c351666047c59ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a527a390a255a81a50ce23662ae7c011c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_colormap.html#a527a390a255a81a50ce23662ae7c011c">setMono</a> (<a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a> color0, <a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a> color1)</td></tr>
<tr class="memdesc:a527a390a255a81a50ce23662ae7c011c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set a monochrome palette, in entries [0] and [1].  <a href="#a527a390a255a81a50ce23662ae7c011c">More...</a><br/></td></tr>
<tr class="separator:a527a390a255a81a50ce23662ae7c011c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a94dd30283795b4fa6635d3e8c364ca4a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_colormap.html#a94dd30283795b4fa6635d3e8c364ca4a">setMono</a> (uint32_t color0, uint32_t color1)</td></tr>
<tr class="memdesc:a94dd30283795b4fa6635d3e8c364ca4a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set a monochrome palette, in entries [0] and [1].  <a href="#a94dd30283795b4fa6635d3e8c364ca4a">More...</a><br/></td></tr>
<tr class="separator:a94dd30283795b4fa6635d3e8c364ca4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afcea0572668aa6e9a6fe103c6ed40357"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afcea0572668aa6e9a6fe103c6ed40357"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_colormap.html#afcea0572668aa6e9a6fe103c6ed40357">setRange</a> (const <a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a> *colors, unsigned firstColor, unsigned numColors)</td></tr>
<tr class="memdesc:afcea0572668aa6e9a6fe103c6ed40357"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set a range of colormap values, given an array of <a class="el" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> values. <br/></td></tr>
<tr class="separator:afcea0572668aa6e9a6fe103c6ed40357"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a931de7625a820b0b422b465806aca9a8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a931de7625a820b0b422b465806aca9a8"></a>
_SYSVideoBuffer &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_colormap.html#a931de7625a820b0b422b465806aca9a8">videoBuffer</a> ()</td></tr>
<tr class="memdesc:a931de7625a820b0b422b465806aca9a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the <a class="el" href="struct_sifteo_1_1_video_buffer.html" title="A memory buffer which holds graphics data.">VideoBuffer</a> associated with this drawable. <br/></td></tr>
<tr class="separator:a931de7625a820b0b422b465806aca9a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:afafcb0570a05cffb1d6bb332fc486830"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afafcb0570a05cffb1d6bb332fc486830"></a>
static const unsigned&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_colormap.html#afafcb0570a05cffb1d6bb332fc486830">NUM_COLORS</a> = 16</td></tr>
<tr class="memdesc:afafcb0570a05cffb1d6bb332fc486830"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maximum number of colors in the colormap. <br/></td></tr>
<tr class="separator:afafcb0570a05cffb1d6bb332fc486830"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>An accessor for the colormap, with up to 16 colors. </p>
<p>This colormap is used by the SOLID_MODE, FB32, FB64, and FB128 modes.</p>
<p>Colors are stored in 16-bit <a class="el" href="struct_sifteo_1_1_r_g_b565.html" title="Represents a 16-bit 5:6:5 color, the native format used by our display.">RGB565</a> format.</p>
<p>Note that, due to details of the radio compression protocol, even-numbered colormap indices will compress better in the FB32 mode. This means it can give better performance if you allocate the most common color values to even-numbered slots. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="acacffa36ca71f5ca1f59bfbc3aadc5be"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_sifteo_1_1_colormap_slot.html">ColormapSlot</a> Sifteo::Colormap::operator[] </td>
          <td>(</td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>index</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return a <a class="el" href="struct_sifteo_1_1_colormap_slot.html" title="A ColormapSlot refers to a single colormap index on a single cube.">ColormapSlot</a> which references a single colormap entry on a single <a class="el" href="struct_sifteo_1_1_video_buffer.html" title="A memory buffer which holds graphics data.">VideoBuffer</a>. </p>
<p>You don't need to store this reference typically; for example: </p>
<pre class="fragment">vbuf.colormap[16].set(1.f, 0.f, 0.f);</pre> 
</div>
</div>
<a class="anchor" id="a3262a55bf13333943c351666047c59ff"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Sifteo::Colormap::setEGA </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Set the entire palette to the traditional EGA 16-color palette. </p>
<p><a href="http://en.wikipedia.org/wiki/Enhanced_Graphics_Adapter#Color_palette">http://en.wikipedia.org/wiki/Enhanced_Graphics_Adapter#Color_palette</a> </p>

</div>
</div>
<a class="anchor" id="a527a390a255a81a50ce23662ae7c011c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Sifteo::Colormap::setMono </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a>&#160;</td>
          <td class="paramname"><em>color0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_sifteo_1_1_r_g_b565.html">RGB565</a>&#160;</td>
          <td class="paramname"><em>color1</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Set a monochrome palette, in entries [0] and [1]. </p>
<p>This is common in the two-color modes, FB64 and FB128. </p>

</div>
</div>
<a class="anchor" id="a94dd30283795b4fa6635d3e8c364ca4a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void Sifteo::Colormap::setMono </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>color0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>color1</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Set a monochrome palette, in entries [0] and [1]. </p>
<p>This is common in the two-color modes, FB64 and FB128.</p>
<p>Colors are specified as packed RGB values, in the format 0xRRGGBB. </p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="color_8h_source.html">color.h</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
    <hr class="footer"/>
    <address class="footer">
        <p><a href="http://sifteo.com">Sifteo</a> SDK v1.0.0 <small>(see <a href="https://developers.sifteo.com/sifteosdk">all versions</a>)</small></p>
        <p>Last updated Wed Mar 27 2013, by <a href="http://www.stack.nl/~dimitri/doxygen">Doxygen</a></p>
    </address>
</body>
</html>
